package com.xqboss.apps.service.equipment;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xqboss.apps.domain.equipment.EquipmentFixRecord;
import com.xqboss.apps.mapper.equipment.EquipmentFixRecordMapper;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class EquipmentFixRecordService extends ServiceImpl<EquipmentFixRecordMapper, EquipmentFixRecord> {

    /**
     *  添加装备修复记录
     * @param userId 用户ID
     * @param userNftId 用户藏品ID
     * @param nftNumberId 藏品编号ID
     * @param currentDurability 当前耐久度
     * @param targetDurability 目标耐久度
     * @param useIntegral 消耗积分
     */
    public void add(Long userId, Long userNftId, Long nftNumberId, BigDecimal currentDurability, BigDecimal targetDurability, BigDecimal useIntegral, BigDecimal useWrench){
        EquipmentFixRecord record = new EquipmentFixRecord();
        record.setUserId(userId);
        record.setUserNftId(userNftId);
        record.setNftNumberId(nftNumberId);
        record.setCurrentDurability(currentDurability);
        record.setTargetDurability(targetDurability);
        record.setIntegral(useIntegral);
        record.setWrench(useWrench);
        save(record);
    }

}
